<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" th:href="@{/bootstrap-3.3.7-dist/css/bootstrap.css}">
    <script th:src="@{/bootstrap-3.3.7-dist/jquery-1.9.1.js}"></script>
    <script th:src="@{/bootstrap-3.3.7-dist/js/bootstrap.js}"></script>
    <script type="text/javascript">
        $(function () {
            $.getJSON("/querySort", function (sortList) {
                $.each(sortList, function (index, p) {
                    var option = "<option value='" + p.id + "'>" + p.name + "</option>";
                    $("select").append(option);
                })
            })
            $("input[type='button']").click(function () {
                location.href = "/handler/toList";
            })
        })
    </script>
</head>
<body>
<div class="container">
    <br>
    <div class="row">
        <div class="col-md-8 col-md-offset-2">
            <form th:action="@{/handler/save}">
                <table class="table table-bordered">
                    <tr>
                        <th colspan="2" class="text-center">
                            发布新贴
                        </th>
                    </tr>
                    <tr>
                        <td>发布版区</td>
                        <td>
                            <select name="sortId">
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>作者</td>
                        <td>
                            <input type="text" name="author">
                        </td>
                    </tr>
                    <tr>
                        <td>标题</td>
                        <td>
                            <input type="text" name="title">
                        </td>
                    </tr>
                    <tr>
                        <td>详细内容</td>
                        <td>
                            <textarea name="detail"></textarea>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="text-center">
                            <input type="submit" value="提交">
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <input type="button" value="返回">
                        </td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
</div>
</body>
</html>